home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / laptop-mode-tools / modules / lcd-brightness < prev    next >
Text File  |  2009-10-06  |  1KB  |  38 lines

  1. #! /bin/sh
  2. #
  3. # Laptop mode tools module: control LCD brightness
  4. #
  5.  
  6.  
  7.  
  8. # Control LCD brightness
  9. if [ x$CONTROL_BRIGHTNESS = x1 ] ; then
  10.     if [ $ON_AC -eq 1 ]; then
  11.         if [ "$ACTIVATE" -eq 1 ]; then
  12.             BRIGHTNESS_COMMAND="$LM_AC_BRIGHTNESS_COMMAND"
  13.         else
  14.             BRIGHTNESS_COMMAND="$NOLM_AC_BRIGHTNESS_COMMAND"
  15.         fi
  16.     else
  17.         BRIGHTNESS_COMMAND="$BATT_BRIGHTNESS_COMMAND"
  18.     fi
  19.     if [ -f /var/run/laptop-mode-tools/state-brightness-command ] ; then
  20.         OLD_BRIGHTNESS_COMMAND="$( cat /var/run/laptop-mode-tools/state-brightness-command )"
  21.     fi
  22.     
  23.     if [ "$FORCE" -ne 0 -o "$BRIGHTNESS_COMMAND" != "$OLD_BRIGHTNESS_COMMAND" ] ; then
  24.         $LM_VERBOSE && echo "Set LCD brightness using command $BRIGHTNESS_COMMAND \> $BRIGHTNESS_OUTPUT." >> $OUTPUT
  25.         if ( $BRIGHTNESS_COMMAND > $BRIGHTNESS_OUTPUT ) ; then
  26.             $LM_VERBOSE && echo "Command succeeded." >> $OUTPUT
  27.         else
  28.             echo "The configured LCD brightness command of the lcd-brightness module failed." >> /dev/stderr
  29.             echo "Please check your configuration in /etc/laptop-mode/conf.d/lcd-brightness.conf." >> /dev/stderr
  30.             $LM_VERBOSE && echo "Command failed."  >> $OUTPUT
  31.         fi
  32.         echo -n $BRIGHTNESS_COMMAND > /var/run/laptop-mode-tools/state-brightness-command
  33.     else
  34.         $LM_VERBOSE && echo "Not setting LCD brightness -- command was the same as last time." >> $OUTPUT
  35.     fi
  36. fi
  37.  
  38.